using System;
using System.Collections.Generic;
using System.Text;

namespace Adoor.Mapping.Attributes
{
    [Serializable, AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
    public class PropertyAttribute:BaseAttribute 
    {
                public PropertyAttribute():base(0)
        {
        }

        public PropertyAttribute(int position)
            : base(position)
        {
        }

        /*<CodePostal xmlns:env="urn:xmd-environment">
      <typing:property type="System.String">
      </typing:property>
      <mapping:property readOnly="false" column="code_postal" length="30">
      </mapping:property>
    </CodePostal>*/

        public Type PropertyType
        {
            get { return propertyType; }
            set { propertyType = value; }
        }

        public bool Readonly
        {
            get { return _readonly; }
            set { _readonly = value; }
        }

        public string Column
        {
            get { return column; }
            set { column = value; }
        }
        public int Length
        {
            get { return length; }
            set { length = value; }
        }

        private Type propertyType = typeof(string);
        private bool _readonly = false;
        private string column = string.Empty;
        private int length = 150;


        public override void AcceptVisitor(IVisitor visitor, System.Reflection.MemberInfo member)
        {
            visitor.Visit(this, member);
        }
    }
}
